package com.itheima.test.newcustomer;

public class Desk {//面向对象的桌子类
    private int HamburgerNumber;
    private boolean flag ;
    //共用的Lock,用final修饰
    private final Object lock = new Object();

    public Desk() {//汉堡包数量,默认10个,汉堡包存在状态,默认不存在
        this(10,false);
    }

    public Desk(int hamburgerNumber, boolean flag) {
        HamburgerNumber = hamburgerNumber;
        this.flag = flag;
    }

    public int getHamburgerNumber() {
        return HamburgerNumber;
    }

    public void setHamburgerNumber(int hamburgerNumber) {
        HamburgerNumber = hamburgerNumber;
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public Object getLock() {
        return lock;
    }

    @Override
    public String toString() {
        return "Desk{" +
                "HamburgerNumber=" + HamburgerNumber +
                ", flag=" + flag +
                ", lock=" + lock +
                '}';
    }
}
